
<a class="btn btn-xs btn-twitter" href="/xqc/products/material/{{ $model->id }}/edit">编辑</a>
{{--@if($model->status == \App\Models\Product\ProductMaterial::STATUS_YES)
    <button class="btn btn-xs btn-success add-modal" title="添加材料供应商" data-id="{{ $model->id }}"
            data-action="addMaterialSupplier">添加供应商
    </button>
@else
    <a data-id="{{ $model->id }}" href="javascript:void(0);" class="btn btn-xs btn-danger grid-row-delete">删除</a>
@endif--}}

<div class="modal fade" id="createModal">
    <div class="modal-dialog" style="width: 50%;">
        <div class="modal-content">
            <!-- 内容会加载到这里 -->
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script language="JavaScript" type="text/javascript">
    $(function () {

        //添加产品
        $('.add-modal').on('click', function(e) {
            e.preventDefault();
            let id = $(this).data('id');
            let action = $(this).data('action');
            $("#createModal").modal({
                remote : '/xqc/products/material-modal?param=' + id + '&action=' + action,
            });
        });
        $("#createModal").on("hidden.bs.modal", function() {
            $(this).removeData("bs.modal");
            $(this).find(".modal-content").children().remove();
        });

    });
</script>
